import Main from '@/views/Main.vue';

// 不作为Main组件的子页面展示的页面单独写，如下
export const loginRouter = {
    path: '/login',
    name: 'login',
    meta: {
        title: 'Login - 登录'
    },
    component: resolve => { require(['@/views/login.vue'], resolve); }
};

export const page404 = {
    path: '/*',
    name: 'error-404',
    meta: {
        title: '404-页面不存在'
    },
    component: resolve => { require(['@/views/error-page/404.vue'], resolve); }
};

export const page403 = {
    path: '/403',
    meta: {
        title: '403-权限不足'
    },
    name: 'error-403',
    component: resolve => { require(['@//views/error-page/403.vue'], resolve); }
};

export const page500 = {
    path: '/500',
    meta: {
        title: '500-服务端错误'
    },
    name: 'error-500',
    component: resolve => { require(['@/views/error-page/500.vue'], resolve); }
};

export const preview = {
    path: '/preview',
    name: 'preview',
    component: resolve => { require(['@/views/form/article-publish/preview.vue'], resolve); }
};

export const locking = {
    path: '/locking',
    name: 'locking',
    component: resolve => { require(['@/views/main-components/lockscreen/components/locking-page.vue'], resolve); }
};

// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
    path: '/',
    name: 'progressManagement',
    redirect: '/progressManagement',
    component: Main,
    children: [
        /*
        { path: 'home', title: { i18n: 'home' }, name: 'home_index', component: resolve => { require(['@/views/home/home.vue'], resolve); } },
        { path: 'ownspace', title: '个人中心', name: 'ownspace_index', component: resolve => { require(['@/views/own-space/own-space.vue'], resolve); } },
        { path: 'order/:order_id', title: '订单详情', name: 'order_info', component: resolve => { require(['@/views/advanced-router/component/order-info.vue'], resolve); } },  // 用于展示动态路由
        { path: 'shopping', title: '购物详情', name: 'shopping', component: resolve => { require(['@/views/advanced-router/component/shopping-info.vue'], resolve); } },  // 用于展示带参路由
        { path: 'message', title: '消息中心', name: 'message_index', component: resolve => { require(['@/views/message/message.vue'], resolve); } }
        */
        { path: 'index', title: '进度管理', name: 'progressManagement_index', component: resolve => { require(['@/views/progressManagement.vue'], resolve); } }
    ]
};

// 作为Main组件的子页面展示并且在左侧菜单显示的路由写在appRouter里
export const appRouter = [
    {
        path: '/companyIntroduction',
        icon: 'eye',
        name: 'companyIntroduction',
        title: '公司介绍',
        component: Main,
        children: [
            { path: 'index', title: '公司介绍', name: 'companyIntroduction_index', component: resolve => { require(['@/views/companyIntroduction.vue'], resolve); } }
        ]
    },
    {
        path: '/ceoMessage',
        icon: 'earth',
        title: 'CEO寄语',
        name: 'ceoMessage',
        component: Main,
        children: [
            { path: 'index', title: 'CEO寄语', name: 'ceoMessage_index', component: resolve => { require(['@/views/ceoMessage.vue'], resolve); } }
        ]
    },
    {
        path: '/companyVision',
        icon: 'star',
        title: '公司愿景',
        name: 'companyVision',
        component: Main,
        children: [
            { path: 'index', title: '公司愿景', name: 'companyVision_index', component: resolve => { require(['@/views/companyVision.vue'], resolve); } }
        ]
    },
    {
        path: '/managementTeam',
        icon: 'heart',
        title: '管理团队',
        name: 'managementTeam',
        component: Main,
        children: [
            { path: 'index', title: '管理团队', name: 'managementTeam_index', component: resolve => { require(['@/views/managementTeam.vue'], resolve); } }
        ]
    },
    {
        path: '/scientificConsultant',
        icon: 'university',
        title: '科学顾问委员会',
        name: 'scientificConsultant',
        component: Main,
        children: [
            { path: 'index', title: '科学顾问委员会', name: 'scientificConsultant_index', component: resolve => { require(['@/views/scientificConsultant.vue'], resolve); } }
        ]
    },
    {
        path: '/investor',
        icon: 'person-stalker',
        title: '投资人',
        name: 'investor',
        component: Main,
        children: [
            { path: 'index', title: '投资人', name: 'investor_index', component: resolve => { require(['@/views/investor.vue'], resolve); } }
        ]
    },
    {
        path: '/news',
        icon: 'android-clipboard',
        title: '新闻',
        name: 'news',
        component: Main,
        children: [
            { path: 'index', title: '新闻', name: 'news_index', component: resolve => { require(['@/views/news.vue'], resolve); } }
        ]
    },
    {
        path: '/cooperationMode',
        icon: 'printer',
        title: '合作方式',
        name: 'cooperationMode',
        component: Main,
        children: [
            { path: 'index', title: '合作方式', name: 'cooperationMode_index', component: resolve => { require(['@/views/cooperationMode.vue'], resolve); } }
        ]
    },
    {
        path: '/cooperativePartner',
        icon: 'person-add',
        title: '合作伙伴',
        name: 'cooperativePartner',
        component: Main,
        children: [
            { path: 'index', title: '合作伙伴', name: 'cooperativePartner_index', component: resolve => { require(['@/views/cooperativePartner.vue'], resolve); } }
        ]
    },
    {
        path: '/contactUs',
        icon: 'document-text',
        title: '联系我们',
        name: 'contactUs',
        component: Main,
        children: [
            { path: 'index', title: '联系我们', name: 'contactUs_index', component: resolve => { require(['@/views/contactUs.vue'], resolve); } }
        ]
    },
    {
        path: '/progressManagement',
        icon: 'social-buffer',
        title: '进度管理',
        name: 'progressManagement',
        component: Main,
        children: [
            { path: 'index', title: '进度管理', name: 'progressManagement_index', component: resolve => { require(['@/views/progressManagement.vue'], resolve); } }
        ]
    },
    {
        path: '/development',
        icon: 'network',
        title: '开发',
        name: 'development',
        component: Main,
        children: [
            { path: 'index', title: '开发', name: 'development_index', component: resolve => { require(['@/views/development.vue'], resolve); } }
        ]
    },
    {
        path: '/production',
        icon: 'settings',
        title: '生产',
        name: 'production',
        component: Main,
        children: [
            { path: 'index', title: '生产', name: 'production_index', component: resolve => { require(['@/views/production.vue'], resolve); } }
        ]
    },
    {
        path: '/clinical',
        icon: 'ios-flask',
        title: '临床',
        name: 'clinical',
        component: Main,
        children: [
            { path: 'index', title: '临床', name: 'clinical_index', component: resolve => { require(['@/views/clinical.vue'], resolve); } }
        ]
    },
    {
        path: '/banner',
        icon: 'images',
        title: 'banner图管理',
        name: 'banner',
        component: Main,
        children: [
            { path: 'index', title: 'banner图管理', name: 'banner_index', component: resolve => { require(['@/views/banner.vue'], resolve); } }
        ]
    },
    {
        path: '/indexText',
        icon: 'android-textsms',
        title: '首页文字管理',
        name: 'indexText',
        component: Main,
        children: [
            { path: 'index', title: '首页文字管理', name: ' indexText_index', component: resolve => { require(['@/views/indexText.vue'], resolve); } }
        ]
    }
];

// 所有上面定义的路由都要写在下面的routers里
export const routers = [
    loginRouter,
    otherRouter,
    preview,
    locking,
    ...appRouter,
    page500,
    page403,
    page404
];
